<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/echarts@5.3.0/dist/echarts.min.js"></script>
</head>
<body>
    
    <body>

        <div id="main" style="width: 600px;height:400px;"></div>
        <div id="main1" style="width: 600px;height:400px;"></div>
    
    <script>
    
            var myChart = echarts.init(document.getElementById('main'));
    
            var option = {
                title: {
                text: '一周消费 柱状图'
                },
                tooltip: { //提示信息
              
                },
                legend: {
                data: ['吃的','用的','总计']
                },
                xAxis: {
                    type: 'category',
                    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
                },
                yAxis: {
                    type: 'value'
                },
                series: [{
                    name: '吃的',
                    data: [11,8,11.12,0,0,58.4,15],
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: 'rgba(180, 180, 180, 0.2)'
                    }
                },
                {
                    name: '用的',
                    data: [0,309,32.71,80,0,9.9,69.9],
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: 'rgba(180, 180, 180, 0.2)'
                    }
                },
                {
                    name: '总计',
                    data: [11,317,43.91,80,0,68.3,84.5],
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: 'rgba(180, 180, 180, 0.2)'
                    }
                }
            ]
            };
         // 使用刚指定的配置项和数据显示图表。
          myChart.setOption(option);
    
    
          
     var myChart1 = echarts.init(document.getElementById('main1'));
    
    var option1 = {
        title: {
        text: '一周消费 折线图'
        },
        tooltip: { //提示信息
      
        },
        legend: {
        data: ['吃的','用的','总计']
        },
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            boundaryGap: false, // 边界缝隙
            type: 'value'
        },
        series: [{
            name: '吃的',
            data: [11,8,11.12,0,0,58.4,15],
            type: 'line',
            smooth:false, //变的丝滑
          
        },
        {
            name: '用的',
            data: [0,309,32.71,80,0,9.9,69.9],
            type: 'line',
            smooth:false, //变的丝滑
          
        },
        {
            name: '总计',
            data: [11,317,43.91,80,0,68.3,84.5],
            type: 'line',
            smooth:false, //变的丝滑
          
        }
    ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart1.setOption(option1);
    
    
    
    
        </script>
    </body>
</body>
</html>